<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>充值</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="/zhenze/Public/home/css/reset.css"/>
		<link rel="stylesheet" href="/zhenze/Public/home/css/chongzhi.css" />
		<link rel="stylesheet" href="/zhenze/Public/home/css/font-awesome.min.css" />
	</head>
	<body>
		<div class="top">
			<a href="javascript:history.go(-1);"><i class="fa fa-angle-left"></i></a>
			<p>充值</p>
		</div>
		<div class="cont">
			<input type="text" placeholder="请输入充值金额"  id="jine"/>
			<input type="tel" placeholder="请输入电话号码" id="tel" onkeyup='this.value=this.value.replace(/\D/gi,"")'/>
		    <input type="text"  style="display" id="submit"/>
		</div>
		<div class="cont1">
			<h1>面值</h1>
			<ul>
				<li>10元</li>
				<li>20元</li>
				<li>50元</li>
				<li>100元</li>
				<li>150元</li>
				<li>200元</li>
				<div class="clear"></div>
			</ul>
		</div>
		<p class="px">即时充值，享受95折优惠哦！</p>
		<div class="cont2">
			<ul>
				<li>
					<img style="margin-left: 0.25rem; margin-right: 0.8rem;" src="/zhenze/Public/home/img/money.png" />
					<p style="margin-right: 5.75rem;">我的佣金</p>
					<p><?php echo ($data[0]['money']); ?></p>
					<img id="img1" src="/zhenze/Public/home/img/true.png" />
					<div class="clear"></div>
				</li>
				<li>
					<img style="margin-right: 0.5rem;" src="/zhenze/Public/home/img/webkit.png" />
					<p>微信支付</p>
					<img id="img2" src="/zhenze/Public/home/img/false.png" />
					<div class="clear"></div>
				</li>
			</ul>
		</div>
		<button id="chongzhi">充值</button>
		<script type="text/javascript" src="/zhenze/Public/home/js/jquery-3.1.1.min.js" ></script>
		<script src="/zhenze/Public/home/js/screenSize.js" type="text/javascript" charset="utf-8"></script>
		<script>
        	$(function(){
        		 var  zhifutype=0;//微信支付为0，余额支付为1
        		$('#img1').click(function(){
        			$("#img1").attr('src','/zhenze/Public/home/img/true.png');
        			$("#img2").attr('src','/zhenze/Public/home/img/false.png');
        			zhifutype=1;
        		});
        		$('#img2').click(function(){
        			$("#img1").attr('src','/zhenze/Public/home/img/false.png');
        			$("#img2").attr('src','/zhenze/Public/home/img/true.png');
        		})
        		
        		
               $('#jine').change(function(){
                  var money=$('#jine').val();
                  //alert(money);
                  var yongjin="<?php echo ($data[0]['money']); ?>";
                   yongjin=parseFloat(yongjin);
                  if(money>yongjin)
                      {
	                      alert('佣金不足,请选择其他支付方式');
	                      return false;
                      }else{
                      	//佣金充足
                      $('.cont1 li').css("border-color","#0195FF");
                      alert($('#jine').val());
                      $('#submit').val($('#jine').val()+"元");
                      }
                   })
               //给每个面值绑定单击事件
               for (var i=0;i<6;i++) {
               	  $('.cont1 li:eq('+i+')').click(function(){
//             	  	$(this).text();
                    $('.cont1 li').css("border-color","#0195FF");
               	  	alert($(this).text());
               	  	$(this).css("border-color","red");
               	  	$('#submit').val($(this).text());
               	  	$('#jine').val('');//选择固定套餐时把自由输入金额置空
               	  })
               }
               
          $('#chongzhi').click(function(){
          	  if(zhifutype==0){
          	  	//微信支付
          	  	
          	  }else if($('')){
          	  //余额支付	
          	  	
          	  	
          	  }
          	
//          $.ajax({
//             	type:"get",
//             	url:"<?php echo U('Htty/payment','','','false','true');?>",
//             	dataType:"json",
//             	data:{
//             	   ''	
//             	},
//             	success:function(data){
//             		alert(1);
//             	},
//             	error:function(data){
//             		alert(data.ERROR)
//             	}
//             });
            })
           	
        	})
          
        </script>
	</body>
</html>